package com.zyd.shiro.persistence.dao;


import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import com.zyd.shiro.persistence.beans.Category;import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * 数据访问接口
 *
 * @author Administrator
 */
public interface MallCategoryDao extends JpaRepository<Category, Integer>, JpaSpecificationExecutor<Category> {

    public Category findByName(String category_name);

    @Query(value = "select * from mall_category  category where  category.parent_id =?1",nativeQuery = true)
    public List<Category> findByParent_id(Integer parentId);


}
